<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>用户表单</title>
    <jsp:include page="/includes/header.jsp"></jsp:include>

</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

    <jsp:include page="/includes/nav.jsp"></jsp:include>

    <jsp:include page="/includes/menu.jsp"></jsp:include>

    <div class="content-wrapper">
        <section class="content-header">
            <h1>
                用户表单
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-user"></i> 用户管理</a></li>
                <li class="active">${tbuser != null ? "修改" : "添加"}</li>
            </ol>
        </section>

        <section class="content">
            <div class="row">
                <div class="col-md-12">

                    <div class="box box-info">
                        <div class="box-header with-border">
                            <h3 class="box-title">${tbuser != null ? "修改用户":"添加用户"}</h3>
                        </div>
                        <!-- /.box-header -->
                        <!-- form start -->
                        <form class="form-horizontal" action="${tbuser!=null ? '/userEdit':'/userAdd'}" method="post">
                            <input type="hidden" name="pageSize" value="${param.pageSize}">
                            <c:if test="${param.pageNum !=null}">
                                <input type="hidden" name="pageNum" value="${param.pageNum}">
                            </c:if>
                            <input type="hidden" name="id" value="${ tbuser.id}">
                            <div class="box-body">
                                <div class="form-group">
                                    <label for="inputname" class="col-sm-2 control-label">用户名</label>

                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" id="inputname" placeholder="name"
                                               value="${tbuser.userName}" name="userName" style="width: 260px ">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="inputEmail3" class="col-sm-2 control-label">邮箱</label>

                                    <div class="col-sm-10">
                                        <input type="email" class="form-control" id="inputEmail3" placeholder="Email"
                                               value="${tbuser.email}" name="email" style="width: 260px ">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="inputPassword3" class="col-sm-2 control-label">密码</label>

                                    <div class="col-sm-10">
                                        <input type="password" class="form-control" id="inputPassword3"
                                               placeholder="Password"
                                               value="${tbuser.password}" name="password" style="width: 260px ">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="inputphone" class="col-sm-2 control-label">电话</label>

                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" id="inputphone" placeholder="phone"
                                               value="${tbuser.phone}" name="phone" style="width: 260px ">
                                    </div>
                                </div>

                            </div>
                            <!-- /.box-body -->
                            <div class="box-footer">
                                <a href="user_list" type="button" class="btn btn-default">取消</a>
                                <button type="submit" class="btn btn-info pull-right">提交</button>
                            </div>
                            <!-- /.box-footer -->
                        </form>
                    </div>
                </div>
            </div>
        </section>
    </div>
    <jsp:include page="includes/copyright.jsp"></jsp:include>
</div>
<c:if test="${message!=null}">
<div class="callout callout-info" id="back"
     style="width: 200px;height: 120px; right: 40%;top: 30%;position: absolute;color:white;text-align: center">
    <h4 style="color:midnightblue;margin-top: 12%">${message}</h4>
    <p align="center">
        <a type="button" class="btn bg-purple margin"
           href="/user_list?pageNum=${reqPageNum}&pageSize=${reqPageSize}">
            确认</a></p>

        <%--<span id="reqPageN" >${reqPageNum}</span>
        <span id="reqPageS" >${reqPageSize}</span>--%>
</div>

</c:if>


<jsp:include page="includes/footer.jsp"></jsp:include>

<%-- <script>
     function message() {
         $.ajax({
             type: "post",
             url: "/saveUser",

             tabatype: "text",
             success: function (data) {
                 console.log(data);
                 $("#mess").html(data);
             }
         })
     }

 </script>--%>
<%--<script>
    function ok() {
        $("#back").hide();
        var pageinN=$("#reqPageN").html();
        var pageinS=$("#reqPageS").html();
        var pagein="/user_list?pageNum="+pageinN+"&pageSize="+pageinS;
        window.location.href=pagein;
    }

</script>--%>


<
/body>
< /html>